﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="BCDTMacHopDong.aspx.cs" Inherits="BCDTMacHopDong" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Báo cáo doanh thu theo mác hợp đồng
                        <asp:DropDownList ID="dlLoaiBaoCao" AutoPostBack="true" runat="server" Width="200px"
                            CssClass="form-control" 
                            onselectedindexchanged="dlLoaiBaoCao_SelectedIndexChanged">
                            <asp:ListItem Text="BCDT tổng hợp"></asp:ListItem>
                            <asp:ListItem Text="BCDT mác hợp đồng" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="BCDT biển số xe"></asp:ListItem>
                            <asp:ListItem Text="BCDT NVKD"></asp:ListItem>
                            <asp:ListItem Text="BCDT xe bơm"></asp:ListItem>
                            <asp:ListItem Text="BCDT giá vật liệu"></asp:ListItem>
                            <asp:ListItem Text="BCDT theo khách hàng"></asp:ListItem>
                            <asp:ListItem Text="BCDT vật liệu tiêu hao"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnXem" ValidationGroup="Them" CssClass="btn btn-warning" runat="server" Text="Tìm kiếm"
                            OnClick="btnXem_Click" />
                        <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                            Text="Xuất báo cáo" CssClass="btn btn-primary" OnClick="btnPrint_Click" />
                    </h3>
                </div>
                <div class="panel-body">
                    <div>
                        <asp:DropDownList ID="dlThang" AutoPostBack="true" runat="server" Width="150px" CssClass="form-control"
                            OnSelectedIndexChanged="dlThang_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNam" AutoPostBack="true" OnSelectedIndexChanged="dlThang_SelectedIndexChanged"
                            runat="server" Width="110px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:TextBox ID="txtTuNgay" runat="server" AutoPostBack="true" OnTextChanged="dlThang_SelectedIndexChanged"
                            placeholder="Từ ngày" Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" OnTextChanged="dlThang_SelectedIndexChanged"
                            AutoPostBack="true" Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        
                        <asp:DropDownList ID="dlLoaiKH" ToolTip="Chọn loại khách hàng" runat="server" 
                            AutoPostBack="true" DataValueField="IDs"
                            Width="120px" CssClass="form-control" DataTextField="TenLoaiKH" 
                            onselectedindexchanged="dlLoaiKH_SelectedIndexChanged">
                        </asp:DropDownList>
                        
                        <asp:DropDownList ID="dlKhachHang" ToolTip="Chọn khách hàng" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="200px" CssClass="form-control" 
                            DataTextField="TenKhachHang" 
                            onselectedindexchanged="dlKhachHang_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlCongTrinh" ToolTip="Chọn công trình" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="200px" CssClass="form-control" 
                            DataTextField="TenCongTrinh" 
                            onselectedindexchanged="dlCongTrinh_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlMacHD" ToolTip="Chọn mác hợp đồng" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="150px" CssClass="form-control" 
                            DataTextField="TenMacBeTong" 
                            onselectedindexchanged="dlMacHD_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlLoaiDa" ToolTip="Chọn loại đá" runat="server" Width="140px" CssClass="form-control" DataTextField="LoaiDa" DataValueField="IDs">
                        </asp:DropDownList>

                        <asp:DropDownList ID="dlTramTron" Enabled="false" ToolTip="Chọn trạm trộn" runat="server" Visible="false"
                            DataValueField="IDs" Width="150px" CssClass="form-control" DataTextField="TenTramTron">
                        </asp:DropDownList>
                        
                        <asp:HiddenField ID="hdTuNgay" runat="server" />
                        <asp:HiddenField ID="hdDenNgay" runat="server" />
                        <asp:ValidationSummary ID="ValidationSummary1" HeaderText=""
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                    </div>
                    <div style="width: 100%; margin-top: 0px; overflow-x: auto;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" Width="4000px" CssClass="form-control withall"
                            onrowdatabound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayXuat" HeaderText="Ngày xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="SoPhieu" HeaderText="Số phiếu" ItemStyle-HorizontalAlign="Center" />
                                
                                <asp:BoundField DataField="BienSo" HeaderText="Biển số" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="LaiXe" HeaderText="Lái xe" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="GioXuat" HeaderText="Giờ xuất" ItemStyle-HorizontalAlign="Center" />
                                
                                <asp:BoundField DataField="VAT" HeaderText="VAT"  ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KhachHang" HeaderText="Khách hàng" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="DoSut" HeaderText="Độ sụt" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="MacTX" HeaderText="Mác TX" ItemStyle-HorizontalAlign="Center" />
                                
                                <asp:BoundField DataField="KLThucXuat" HeaderText="KL TX" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="MacHD" HeaderText="Mác HĐ" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLKhachHang" HeaderText="KL bán" ItemStyle-HorizontalAlign="Center" />

                                <asp:BoundField DataField="LoaiDa" HeaderText="Loại đá" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiPhuGia" HeaderText="Phụ gia" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="GiaVatLieu" HeaderText="Giá VL có VAT" ItemStyle-HorizontalAlign="Right"  DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="GiaVatLieuKhongVAT" HeaderText="Giá VL không VAT" ItemStyle-HorizontalAlign="Right"  DataFormatString="{0:0,0}" />

                                <asp:BoundField DataField="TTVL" HeaderText="TTVL có VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTVLKhongVAT" HeaderText="TTVL không VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTVLTH" HeaderText="Thành tiền VLTH" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                
                                <asp:BoundField DataField="GiaHD" HeaderText="Giá HĐ có VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="GiaHDKhongVAT" HeaderText="Giá HĐ không VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                
                                <asp:BoundField DataField="TTGiaHD" HeaderText="TT bê tông có VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTGiaHDKhongVAT" HeaderText="TT bê tông không VAT" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />

                                <asp:BoundField DataField="ChenhKL" HeaderText="Tổng chênh" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N1}" />
                                <asp:BoundField DataField="KLNVKD" HeaderText="Chênh NVKD" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N1}" />
                                <asp:BoundField DataField="KLCongTY" HeaderText="Chênh công ty" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N1}" />

                                <asp:BoundField DataField="TTChenh" HeaderText="TT chênh" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTNVKD" HeaderText="TT NVKD" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTCongTy" HeaderText="TT công ty" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />

                                <asp:BoundField DataField="CongTron" HeaderText="Công trộn" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTCongTron" HeaderText="TT công trộn" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />

                                <asp:BoundField DataField="CuocVC" HeaderText="Cước VC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="TTCVC" HeaderText="Thành tiền CVC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="DTGiaVL" HeaderText="Doanh thu giá VL" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}"  />
                                <asp:BoundField DataField="DTTHVL" HeaderText="Doanh thu THVL" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}"  />
                                <asp:BoundField DataField="TienHoTroCuoc" HeaderText="Tiền hỗ trợ cước" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="LoaiCaBom" HeaderText="Loại ca bơm" ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="TienCaBom" HeaderText="Tiền ca bơm" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:0,0}" />

                                <asp:BoundField DataField="ThanhTienHang" HeaderText="Thành tiền hàng" ItemStyle-HorizontalAlign="Right"  DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="NVKD" HeaderText="NVKD" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="HinhThuc" HeaderText="Hình thức HĐ" ItemStyle-HorizontalAlign="Left" />

                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Right" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                    </div>
                    <div style="margin: 5px;">
                        <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                        <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                            OnClick="btnPre_Click" />
                        <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                            OnClick="btnNext_Click" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>

